'use strict';
const fs = require('fs');
let imgUrl = '../statics/imgs/av02.jpg';
let list = [
    {
        id: 1,
        username: 'admin',
        nickname: '千年早班',
        avatar: imgUrl
    },
    {
        id: 2,
        username: 'admin',
        nickname: '千年早班',
        avatar: imgUrl
    },
    {
        id: 3,
        username: 'admin',
        nickname: '千年早班',
        avatar: imgUrl
    },
    {
        id: 4,
        username: 'admin',
        nickname: '千年早班',
        avatar: imgUrl
    },
    {
        id: 5,
        username: 'admin',
        nickname: '千年早班',
        avatar: imgUrl
    },
    {
        id: 6,
        username: 'admin',
        nickname: '千年早班',
        avatar: imgUrl
    },
]




async function getAll(ctx, next) {
    // console.log(ctx.xx);
    ctx.render('index.html', { nickname: 'bar', list: list });
}
async function getById(ctx, next) {

}
async function addItem(ctx, next) {

}
async function updateItem(ctx, next) {

}
async function delItem(ctx, next) {

}


module.exports = {
    'get /users': getAll,
    'get /users/:id': getById,
    'post /users': addItem,
    'put /users/:id': updateItem,
    'delete /users/:id': delItem,
}
